<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/mytag.jspf"%>

<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<title>user</title>
<script type="text/javascript">
var layerPage;//弹出框关闭时用到
function showShopTree() {
	layerPage = layer.open({
		title : "选择门店",
		type : 2,
		content : 'management/shop/shopTree'
	});
}
function showTreeData(treeNode) {
	$("#shopName").val(treeNode.name);
	$("#shopId").val(treeNode.id);
}


	var names = new Array();
	var mods = new Array();
	var heards = new Array();
	heards[0] =	{startColumnName: 'customTotle', numberOfColumns: 3, titleText: '客流情况'}; 
	names[0] = "姓名";
	mods[0] = {name:"employeeName",width:100};
	
	names[1] = "总量";
	mods[1] = {name:"customTotle",width:100};
	
	names[2] = "熟客";
	mods[2] = {name:"hotCustom",width:100};
	
	names[3] = "生客";
	mods[3] = {name:"strangerCustom",width:100};
	
	var i=4;
	var k=4;
	var j=0;
	var n=1;
	  <c:forEach items="${t}" var="a"> 
	  names[i++] = "数量";
	  names[i++] = "金额";
	  names[i++] = "占项目业绩比例";
	  mods[k++] = {name:"list["+j+"].num",width:100};
	  mods[k++] = {name:"list["+j+"].amount",width:100};
	  mods[k++] = {name:"list["+j+"].percent",width:120};
	  heards[n++] =	{startColumnName: "list["+j+"].num", numberOfColumns: 3, titleText: "${a.name}"};
	  j++;
	  </c:forEach>
	  names[i++] = "业绩";
	  mods[k++] = {name:"results",width:100};
	  names[i++] = "占门店项目业绩比例";
	  mods[k++] = {name:"resultsPercent",width:120};
	  names[i++] = "外卖业绩";
	  mods[k++] = {name:"outResults",width:100};
	  names[i++] = "占门店外卖业绩的比例";
	  mods[k++] = {name:"outResultsPercent",width:120};
	  
	$("#grid").jqGrid({
		pager:"#pager",
		url:"management/report/page",
	   	colNames:names,
	   	colModel:mods
	});
	$("#grid").jqGrid('setGroupHeaders', {
		  useColSpanStyle: false, 
		  groupHeaders:heards
		});
	$("#grid").closest(".ui-jqgrid-bdiv").css({ 'overflow-x' : 'hidden' });
	$(function(){ 
	    $("#searchBtn").click(function(){
	        $("#grid").jqGrid('setGridParam',{ 
	            postData:$("#queryForm").serializeJson(), //发送数据
	            page:1
	        }).trigger("reloadGrid"); //重新载入 
	    }); 
	});
</script>
</head>

<body>
	<ol class="am-breadcrumb am-breadcrumb-slash am-padding" style="margin-bottom: 0px;">
		<li><a href="management/index">首页</a></li>
		<li class="am-active">门店日业绩情况分析报表</li>
	</ol>
	<div class="am-g">
		<form id="queryForm">
		<div class="am-u-md-2">
			<div class="am-input-group am-input-group-sm">
			<input type="text" id="shopName" name="shopName" placeholder="请输选择门店" readonly onclick="showShopTree();">
			<input type="hidden" id="shopId" name="shopId">
			<input type="text" name="begDate" id="begDate" placeholder="请输选择日期"  data-am-datepicker readonly>
			<span class="am-input-group-btn"><button id ="searchBtn" class="am-btn am-btn-default" type="button">搜索</button></span>
			</div>
		</div>
		</form>
	</div>
	<div class="am-g am-padding-vertical">
		<div class="am-u-md-12">
		<table id="grid">
			
		</table>
		</div>
	</div>
</body>
</html>
